<template>
    <div class="module mod-destination" id="abroad">
            <div class="hd">
                <span  class="subtitle" v-if="searchList.length==0">暂时没有搜索到</span>
            </div>
            <div class="bd">
              <ul>
              
                 <li class="J_blocklink" v-for="item in searchList" :key="item.sceneryId" @click="getDetail(item.sceneryId)">
                  <div class="pic">
                    <a  >
                      <img :src="item.sceneryCover" :alt="item.sceneryCity" width="height:258px;100%">
                    </a>
                  </div>
                  <div class="text">
                    <div class="cover"></div>
                    <p>
                      <span class="title">{{item.sceneryCity}}</span>
                      <span class="english">Beijing</span>
                      <span class="subtitle">{{item.sceneryTitle}}</span>
                    </p>
                  </div>
                </li> 
                
              </ul>
            </div>
          </div>


</template>
<script>
export default {
    data(){
        return {
           name:this.$route.query.name,
           searchList:[],
        }
    },
    created(){
        this.searchCity();
    },
    mounted () {
    
    },
    methods:{
         getDetail(id){
          this.$router.push({path:'/home/detail', query:{id : id}})
        },
        searchCity(){
          this.$axios.get('/findCityByName?name='+this.name)
          .then(res=>{
          this.searchList=res.data;
            var arr=[];
            console.log(res)
          })
          .catch(err=>{
            
          })
    },
    },
}
</script>
<style lang="scss" scoped>
 .mod-destination{
   padding-left:20px;
 }
</style>
